package org.dromara.finance.utils;

import org.dromara.finance.domain.report.PurchaseContractReportVO;
import org.dromara.finance.domain.report.SaleContractReportVO;
import org.dromara.finance.domain.vo.PurchaseContractVo;
import org.dromara.finance.domain.vo.SaleContractVo;

public class ReportConverter {

    public static SaleContractReportVO toSaleReportVO(SaleContractVo contract) {
        SaleContractReportVO vo = new SaleContractReportVO();

        // 主表字段映射
        vo.setSaleContractId(contract.getId());
        vo.setSaleContractNum(contract.getSaleContractNum());
        vo.setProjectName(contract.getProjectName());
        vo.setCustomerName(contract.getCustomerName());
        vo.setTransportSection(contract.getTransportSection());
        vo.setSaleCurrency(contract.getCurrency());

        // 别名字段
        vo.setContractLocalTotalAmount(contract.getLocalTotalAmount());
        vo.setContractLocalAmount(contract.getLocalAmount());
        vo.setContractLocalTaxedAmount(contract.getLocalTaxedAmount());

        return vo;
    }
    public static PurchaseContractReportVO toPurchaseReportVo(PurchaseContractVo contract) {
        PurchaseContractReportVO vo = new PurchaseContractReportVO();

        vo.setPurchaseContractNum(contract.getPurchaseContractNum());
        vo.setSupplierName(contract.getSupplierName());
        vo.setPurchaseCurrency(contract.getCurrency());

        vo.setPurchaseLocalTotalAmount(contract.getLocalTotalAmount());
        vo.setPurchaseLocalAmount(contract.getLocalAmount());
        vo.setPurchaseLocalTaxedAmount(contract.getLocalTaxedAmount());

        return vo;

    }
}

